<template>
  <div>
  
    <el-bread></el-bread>
    
    <el-button @click="add" type="primary" plain size="small">添加</el-button>
 
    <v-list @edit="edit"></v-list>

    <v-dialog
      ref="diaInfo"
      @cancel="cancel"
      :dialogInfo="dialogInfo"
    ></v-dialog>
  </div>
</template>

<script>
//引入列表数据
import vList from "./list";
import vDialog from "./dialog";
export default {
  data() {
    return {
      dialogInfo: {
        isShow: false,
        isAdd: true, //是否是添加
      },
    };
  },
  components: {
    vList,
    vDialog,
  },
  methods: {
    add() {
      this.dialogInfo.isShow = true;

      this.dialogInfo.isAdd = true;
    },

    cancel(e) {
      this.dialogInfo.isShow = e;
    },

    edit(e) {
      this.dialogInfo.isShow = true;

      this.dialogInfo.isAdd = false;

      this.$refs.diaInfo.lookup(e);
    },
  },
};
</script>

<style lang="" scoped>
.el-button {
  margin: 20px 5px;
}
</style>
